package com.ruoyi.bookbus.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bookbus.mapper.BookFavoriteMapper;
import com.ruoyi.bookbus.domain.BookFavorite;
import com.ruoyi.bookbus.service.IBookFavoriteService;

/**
 * 收藏Service业务层处理
 * 
 * @author zsq-cj
 * @date 2025-10-21
 */
@Service
public class BookFavoriteServiceImpl implements IBookFavoriteService 
{
    @Autowired
    private BookFavoriteMapper bookFavoriteMapper;

    /**
     * 查询收藏
     * 
     * @param id 收藏主键
     * @return 收藏
     */
    @Override
    public BookFavorite selectBookFavoriteById(Long id)
    {
        return bookFavoriteMapper.selectBookFavoriteById(id);
    }

    /**
     * 查询收藏列表
     * 
     * @param bookFavorite 收藏
     * @return 收藏
     */
    @Override
    public List<BookFavorite> selectBookFavoriteList(BookFavorite bookFavorite)
    {
        return bookFavoriteMapper.selectBookFavoriteList(bookFavorite);
    }

    /**
     * 新增收藏
     * 
     * @param bookFavorite 收藏
     * @return 结果
     */
    @Override
    public int insertBookFavorite(BookFavorite bookFavorite)
    {
        return bookFavoriteMapper.insertBookFavorite(bookFavorite);
    }

    /**
     * 修改收藏
     * 
     * @param bookFavorite 收藏
     * @return 结果
     */
    @Override
    public int updateBookFavorite(BookFavorite bookFavorite)
    {
        return bookFavoriteMapper.updateBookFavorite(bookFavorite);
    }

    /**
     * 批量删除收藏
     * 
     * @param ids 需要删除的收藏主键
     * @return 结果
     */
    @Override
    public int deleteBookFavoriteByIds(Long[] ids)
    {
        return bookFavoriteMapper.deleteBookFavoriteByIds(ids);
    }

    /**
     * 删除收藏信息
     * 
     * @param id 收藏主键
     * @return 结果
     */
    @Override
    public int deleteBookFavoriteById(Long id)
    {
        return bookFavoriteMapper.deleteBookFavoriteById(id);
    }
}
